import { createApp } from 'vue';
import App from './App.vue';

// 通用字体
import 'vfonts/Lato.css';
// 等宽字体
import 'vfonts/FiraCode.css';

import naive from 'naive-ui';

import { createPinia } from 'pinia';

// 全局编辑器
import { basicSetup } from 'codemirror';
import VueCodemirror from 'vue-codemirror';
import { oneDark } from '@codemirror/theme-one-dark';
import { javascript } from '@codemirror/lang-javascript';
import { json } from '@codemirror/lang-json';

import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
import router from './router/router';


const app = createApp(App);
// 关闭警告
app.config.warnHandler = () => { };

const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);

// 挂载编辑器
app.use(VueCodemirror, {
    // optional default global options
    autofocus: true,
    disabled: false,
    indentWithTab: true,
    tabSize: 2,
    placeholder: 'Yoyo：la la la 😭😭😭😭😭   github: ImYoyoDada',
    extensions: [basicSetup,oneDark,json(),javascript()]
});

app.use(pinia);
app.use(router);
app.use(naive);

app.mount('#app');
